﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCResources.General
{
    /// <summary>
    /// serie struct
    /// </summary>
    [Serializable]
    public struct Serie
    {
        private string titel;
        private int season;
        private int episode;
        private DateTime nextAirDate;
        private int frequency;
        private string coverPath;
        private int curSeason;
        private int curEpisode;
        private string transferPath;

        /// <summary>
        /// contructor to create a serie
        /// </summary>
        /// <param name="titel">serie title</param>
        /// <param name="season">current season your viewing</param>
        /// <param name="episode">current episode your at</param>
        /// <param name="nextAirDate"></param>
        /// <param name="frequency"></param>
        /// <param name="curEpisode">current episode that is airing, leave blank if inapplicable</param>
        /// <param name="coverPath"></param>
        /// <param name="curSeason">current season that is airing, leave blank if inapplicable</param>
        public Serie(string titel, int season, int episode, DateTime nextAirDate, int frequency = 0, string coverPath = null, int curSeason = 0, int curEpisode = 0, string transferPath = null)
        {
            this.titel = titel;
            this.season = season;
            this.episode = episode;
            this.nextAirDate = nextAirDate;
            this.coverPath = coverPath;
            this.frequency = frequency;
            this.curSeason = curSeason;
            this.curEpisode = curEpisode;
            this.transferPath = transferPath;
        }


        public string Titel
        {
            get
            {
                return this.titel;
            }

            set
            {
                this.titel = value;
            }
        }

        public int Season
        {
            get
            {
                return this.season;
            }

            set
            {
                this.season = value;
            }
        }

        public int Episode
        {
            get
            {
                return this.episode;
            }

            set
            {
                this.episode = value;
            }
        }

        public DateTime NextAirDate
        {
            get
            {
                return nextAirDate;
            }
            set
            {
                nextAirDate = value;
            }
        }

        public int Frequency
        {
            get
            {
                return frequency;
            }
            set
            {
                frequency = value;
            }
        }


        public string CoverPath
        {
            get
            {
                return coverPath;
            }
            set
            {
                coverPath = value;
            }
        }

        public int CurSeason
        {
            get
            {
                return curSeason;
            }
            set
            {
                curSeason = value;
            }
        }

        public int CurEpisode
        {
            get
            {
                return curEpisode;
            }
            set
            {
                curEpisode = value;
            }
        }

        public string TransferPath
        {
            get
            {
                return transferPath;
            }
            set
            {
                transferPath = value;
            }
        }


        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(titel);
            sb.Append("*");
            sb.Append(season.ToString());
            sb.Append("*");
            sb.Append(episode.ToString());
            sb.Append("*");
            sb.Append(nextAirDate);
            sb.Append("*");
            sb.Append(coverPath);
            return sb.ToString();
        }
    }
}
